Skip to content

sys_fs: Fix ENOTDIR check for paths ending with /dot or /dotdot#19028

Merged
elad335 merged 3 commits into
RPCS3:masterfrom
elad335:idm-o
Jul 14, 2026
Merged

sys_fs: Fix ENOTDIR check for paths ending with /dot or /dotdot#19028
elad335 merged 3 commits into
RPCS3:masterfrom
elad335:idm-o

Conversation

@elad335

@elad335 elad335 commented Jul 14, 2026

Copy link
Copy Markdown
Contributor

Fixes #19021

Adds special ENOTDIR checks for when paths end with /. or /..
In Middle Earth Shadow of Mordor, the path "/dev_hdd0/game/BLUS31059/USRDIR/KeyFile.EDAT/./" is sent to the filesystem pretending that it is a file, but bacause of ./ it cannot be. Therefore ENOTDIR should be returned.

Confirned fixed per #19021 (comment)
17840603996826223684300605038500

@elad335 elad335 changed the title sys_fs: Debug validation layer for ENOTDIR detector sys_fs: Fix ENOTDIR check for paths ending with /dot or /dotdot Jul 14, 2026
@digant73

Copy link
Copy Markdown
Contributor

is maybe #18781 also affected by this PR?

@elad335

elad335 commented Jul 14, 2026

Copy link
Copy Markdown
Contributor Author

@digant73 Updated, please retest.

@digant73

digant73 commented Jul 14, 2026

Copy link
Copy Markdown
Contributor

@digant73 Updated, please retest.

I do not own that game. Just saw the issue in #18781 could also be fixed by this PR

@elad335 elad335 added the Bugfix label Jul 14, 2026
@elad335 elad335 merged commit 49b0306 into RPCS3:master Jul 14, 2026
10 checks passed
// Takes virtual path only
bool ends_with_delim_dot_or_dotdot(std::string_view vpath)
{
if (vpath.find_last_not_of('/') != vpath.size() - 1)

@Megamouse Megamouse Jul 14, 2026

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Isn't this the same as vpath.endsWith(/)

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Weird spaghetti code man

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[Regression] Middle Earth Shadow of Mordor throws a sys_fs error - /./ and /../ should be directory only (#18103)

3 participants